package com.centaline.androidsalesblog.model.businissobject;

import com.centaline.androidsalesblog.model.databaseobject.EsfEstateDo;
import com.centaline.androidsalesblog.model.databaseobject.NewEstActDo;
import com.centaline.androidsalesblog.model.databaseobject.NewEstDo;
import com.centaline.androidsalesblog.model.databaseobject.PostDo;

/**
 * 历史记录逻辑
 * Created by guilin on 16/2/2.
 */
public class HistoryBo {

    private int type;
    private String resourceId;
    private long date;

    private PostDo postDo;//租售
    private EsfEstateDo esfEstateDo;//小区
    private NewEstDo newEstDo;//新盘
    private NewEstActDo newEstActDo;//新盘活动

    public HistoryBo(PostDo postDo, String resourceId, long date) {
        this.postDo = postDo;
        this.resourceId = resourceId;
        this.date = date;
        type = "s".equalsIgnoreCase(postDo.getPostType()) ? 0 : 1;
    }

    public HistoryBo(EsfEstateDo esfEstateDo, String resourceId, long date) {
        this.esfEstateDo = esfEstateDo;
        this.resourceId = resourceId;
        this.date = date;
        type = 2;
    }

    public HistoryBo(NewEstDo newEstDo, String resourceId, long date) {
        this.newEstDo = newEstDo;
        this.resourceId = resourceId;
        this.date = date;
        type = 3;
    }

    public HistoryBo(NewEstActDo newEstActDo, String resourceId, long date) {
        this.newEstActDo = newEstActDo;
        this.resourceId = resourceId;
        this.date = date;
        type = 4;
    }

    public int getType() {
        return type;
    }

    public String getResourceId() {
        return resourceId;
    }

    public long getDate() {
        return date;
    }

    public PostDo getPostDo() {
        return postDo;
    }

    public EsfEstateDo getEsfEstateDo() {
        return esfEstateDo;
    }

    public NewEstDo getNewEstDo() {
        return newEstDo;
    }

    public NewEstActDo getNewEstActDo() {
        return newEstActDo;
    }
}
